Integrand size = 31, antiderivative size = 101 \[ \int \cos (e+f x) (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\frac {a^2 (c-d)^2 (c+d \sin (e+f x))^{1+n}}{d^3 f (1+n)}-\frac {2 a^2 (c-d) (c+d \sin (e+f x))^{2+n}}{d^3 f (2+n)}+\frac {a^2 (c+d \sin (e+f x))^{3+n}}{d^3 f (3+n)} \]
a^2*(c-d)^2*(c+d*sin(f*x+e))^(1+n)/d^3/f/(1+n)-2*a^2*(c-d)*(c+d*sin(f*x+e) )^(2+n)/d^3/f/(2+n)+a^2*(c+d*sin(f*x+e))^(3+n)/d^3/f/(3+n)
Time = 0.27 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.77 \[ \int \cos (e+f x) (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\frac {a^2 (c+d \sin (e+f x))^{1+n} \left (\frac {(c-d)^2}{1+n}-\frac {2 (c-d) (c+d \sin (e+f x))}{2+n}+\frac {(c+d \sin (e+f x))^2}{3+n}\right )}{d^3 f} \]
(a^2*(c + d*Sin[e + f*x])^(1 + n)*((c - d)^2/(1 + n) - (2*(c - d)*(c + d*S in[e + f*x]))/(2 + n) + (c + d*Sin[e + f*x])^2/(3 + n)))/(d^3*f)
Time = 0.34 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.98, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {3042, 3312, 53, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^ndx\) |
\(\Big \downarrow \) 3312 |
\(\displaystyle \frac {\int (\sin (e+f x) a+a)^2 (c+d \sin (e+f x))^nd(a \sin (e+f x))}{a f}\) |
\(\Big \downarrow \) 53 |
\(\displaystyle \frac {\int \left (\frac {a^2 (c-d)^2 (c+d \sin (e+f x))^n}{d^2}-\frac {2 a^2 (c-d) (c+d \sin (e+f x))^{n+1}}{d^2}+\frac {a^2 (c+d \sin (e+f x))^{n+2}}{d^2}\right )d(a \sin (e+f x))}{a f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {a^3 (c-d)^2 (c+d \sin (e+f x))^{n+1}}{d^3 (n+1)}-\frac {2 a^3 (c-d) (c+d \sin (e+f x))^{n+2}}{d^3 (n+2)}+\frac {a^3 (c+d \sin (e+f x))^{n+3}}{d^3 (n+3)}}{a f}\) |
((a^3*(c - d)^2*(c + d*Sin[e + f*x])^(1 + n))/(d^3*(1 + n)) - (2*a^3*(c - d)*(c + d*Sin[e + f*x])^(2 + n))/(d^3*(2 + n)) + (a^3*(c + d*Sin[e + f*x]) ^(3 + n))/(d^3*(3 + n)))/(a*f)
3.10.15.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int [ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0] && LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])
Int[cos[(e_.) + (f_.)*(x_)]*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*(( c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[1/(b*f) Su bst[Int[(a + x)^m*(c + (d/b)*x)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x]
Time = 2.30 (sec) , antiderivative size = 166, normalized size of antiderivative = 1.64
method | result | size |
parallelrisch | \(-\frac {\left (c +d \sin \left (f x +e \right )\right )^{n} \left (2 \left (1+n \right ) \left (\left (2 n +6\right ) d +c n \right ) d^{2} \cos \left (2 f x +2 e \right )+d^{3} \left (2+n \right ) \left (1+n \right ) \sin \left (3 f x +3 e \right )+8 \left (\left (-\frac {7}{8} n^{2}-\frac {29}{8} n -\frac {15}{4}\right ) d^{2}-c n \left (3+n \right ) d +c^{2} n \right ) d \sin \left (f x +e \right )+\left (-4 n^{2}-16 n -12\right ) d^{3}-6 c \left (n^{2}+\frac {11}{3} n +4\right ) d^{2}+8 c^{2} \left (3+n \right ) d -8 c^{3}\right ) a^{2}}{4 f \,d^{3} \left (1+n \right ) \left (3+n \right ) \left (2+n \right )}\) | \(166\) |
derivativedivides | \(\frac {a^{2} \left (\sin ^{3}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{f \left (3+n \right )}+\frac {a^{2} c \left (d^{2} n^{2}-2 c d n +5 d^{2} n +2 c^{2}-6 c d +6 d^{2}\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{3} f \left (n^{3}+6 n^{2}+11 n +6\right )}+\frac {\left (c n +2 n d +6 d \right ) a^{2} \left (\sin ^{2}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{f d \left (n^{2}+5 n +6\right )}-\frac {a^{2} \left (-2 c d \,n^{2}-d^{2} n^{2}+2 c^{2} n -6 c d n -5 d^{2} n -6 d^{2}\right ) \sin \left (f x +e \right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{2} \left (n^{3}+6 n^{2}+11 n +6\right ) f}\) | \(246\) |
default | \(\frac {a^{2} \left (\sin ^{3}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{f \left (3+n \right )}+\frac {a^{2} c \left (d^{2} n^{2}-2 c d n +5 d^{2} n +2 c^{2}-6 c d +6 d^{2}\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{3} f \left (n^{3}+6 n^{2}+11 n +6\right )}+\frac {\left (c n +2 n d +6 d \right ) a^{2} \left (\sin ^{2}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{f d \left (n^{2}+5 n +6\right )}-\frac {a^{2} \left (-2 c d \,n^{2}-d^{2} n^{2}+2 c^{2} n -6 c d n -5 d^{2} n -6 d^{2}\right ) \sin \left (f x +e \right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{2} \left (n^{3}+6 n^{2}+11 n +6\right ) f}\) | \(246\) |
-1/4*(c+d*sin(f*x+e))^n*(2*(1+n)*((2*n+6)*d+c*n)*d^2*cos(2*f*x+2*e)+d^3*(2 +n)*(1+n)*sin(3*f*x+3*e)+8*((-7/8*n^2-29/8*n-15/4)*d^2-c*n*(3+n)*d+c^2*n)* d*sin(f*x+e)+(-4*n^2-16*n-12)*d^3-6*c*(n^2+11/3*n+4)*d^2+8*c^2*(3+n)*d-8*c ^3)*a^2/f/d^3/(1+n)/(3+n)/(2+n)
Leaf count of result is larger than twice the leaf count of optimal. 294 vs. \(2 (101) = 202\).
Time = 0.30 (sec) , antiderivative size = 294, normalized size of antiderivative = 2.91 \[ \int \cos (e+f x) (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\frac {{\left (2 \, a^{2} c^{3} - 6 \, a^{2} c^{2} d + 6 \, a^{2} c d^{2} + 6 \, a^{2} d^{3} + 2 \, {\left (a^{2} c d^{2} + a^{2} d^{3}\right )} n^{2} - {\left (6 \, a^{2} d^{3} + {\left (a^{2} c d^{2} + 2 \, a^{2} d^{3}\right )} n^{2} + {\left (a^{2} c d^{2} + 8 \, a^{2} d^{3}\right )} n\right )} \cos \left (f x + e\right )^{2} - 2 \, {\left (a^{2} c^{2} d - 3 \, a^{2} c d^{2} - 4 \, a^{2} d^{3}\right )} n + {\left (8 \, a^{2} d^{3} + 2 \, {\left (a^{2} c d^{2} + a^{2} d^{3}\right )} n^{2} - {\left (a^{2} d^{3} n^{2} + 3 \, a^{2} d^{3} n + 2 \, a^{2} d^{3}\right )} \cos \left (f x + e\right )^{2} - 2 \, {\left (a^{2} c^{2} d - 3 \, a^{2} c d^{2} - 4 \, a^{2} d^{3}\right )} n\right )} \sin \left (f x + e\right )\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n}}{d^{3} f n^{3} + 6 \, d^{3} f n^{2} + 11 \, d^{3} f n + 6 \, d^{3} f} \]
(2*a^2*c^3 - 6*a^2*c^2*d + 6*a^2*c*d^2 + 6*a^2*d^3 + 2*(a^2*c*d^2 + a^2*d^ 3)*n^2 - (6*a^2*d^3 + (a^2*c*d^2 + 2*a^2*d^3)*n^2 + (a^2*c*d^2 + 8*a^2*d^3 )*n)*cos(f*x + e)^2 - 2*(a^2*c^2*d - 3*a^2*c*d^2 - 4*a^2*d^3)*n + (8*a^2*d ^3 + 2*(a^2*c*d^2 + a^2*d^3)*n^2 - (a^2*d^3*n^2 + 3*a^2*d^3*n + 2*a^2*d^3) *cos(f*x + e)^2 - 2*(a^2*c^2*d - 3*a^2*c*d^2 - 4*a^2*d^3)*n)*sin(f*x + e)) *(d*sin(f*x + e) + c)^n/(d^3*f*n^3 + 6*d^3*f*n^2 + 11*d^3*f*n + 6*d^3*f)
Leaf count of result is larger than twice the leaf count of optimal. 2159 vs. \(2 (85) = 170\).
Time = 3.32 (sec) , antiderivative size = 2159, normalized size of antiderivative = 21.38 \[ \int \cos (e+f x) (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\text {Too large to display} \]
Piecewise((c**n*(a**2*sin(e + f*x)**3/(3*f) + a**2*sin(e + f*x)**2/f + a** 2*sin(e + f*x)/f), Eq(d, 0)), (x*(c + d*sin(e))**n*(a*sin(e) + a)**2*cos(e ), Eq(f, 0)), (2*a**2*c**2*log(c/d + sin(e + f*x))/(2*c**2*d**3*f + 4*c*d* *4*f*sin(e + f*x) + 2*d**5*f*sin(e + f*x)**2) + 3*a**2*c**2/(2*c**2*d**3*f + 4*c*d**4*f*sin(e + f*x) + 2*d**5*f*sin(e + f*x)**2) + 4*a**2*c*d*log(c/ d + sin(e + f*x))*sin(e + f*x)/(2*c**2*d**3*f + 4*c*d**4*f*sin(e + f*x) + 2*d**5*f*sin(e + f*x)**2) + 4*a**2*c*d*sin(e + f*x)/(2*c**2*d**3*f + 4*c*d **4*f*sin(e + f*x) + 2*d**5*f*sin(e + f*x)**2) - 2*a**2*c*d/(2*c**2*d**3*f + 4*c*d**4*f*sin(e + f*x) + 2*d**5*f*sin(e + f*x)**2) + 2*a**2*d**2*log(c /d + sin(e + f*x))*sin(e + f*x)**2/(2*c**2*d**3*f + 4*c*d**4*f*sin(e + f*x ) + 2*d**5*f*sin(e + f*x)**2) - 4*a**2*d**2*sin(e + f*x)/(2*c**2*d**3*f + 4*c*d**4*f*sin(e + f*x) + 2*d**5*f*sin(e + f*x)**2) - a**2*d**2/(2*c**2*d* *3*f + 4*c*d**4*f*sin(e + f*x) + 2*d**5*f*sin(e + f*x)**2), Eq(n, -3)), (- 2*a**2*c**2*log(c/d + sin(e + f*x))/(c*d**3*f + d**4*f*sin(e + f*x)) - 2*a **2*c**2/(c*d**3*f + d**4*f*sin(e + f*x)) - 2*a**2*c*d*log(c/d + sin(e + f *x))*sin(e + f*x)/(c*d**3*f + d**4*f*sin(e + f*x)) + 2*a**2*c*d*log(c/d + sin(e + f*x))/(c*d**3*f + d**4*f*sin(e + f*x)) + 2*a**2*c*d/(c*d**3*f + d* *4*f*sin(e + f*x)) + 2*a**2*d**2*log(c/d + sin(e + f*x))*sin(e + f*x)/(c*d **3*f + d**4*f*sin(e + f*x)) + a**2*d**2*sin(e + f*x)**2/(c*d**3*f + d**4* f*sin(e + f*x)) - a**2*d**2/(c*d**3*f + d**4*f*sin(e + f*x)), Eq(n, -2)...
Time = 0.22 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.81 \[ \int \cos (e+f x) (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\frac {\frac {2 \, {\left (d^{2} {\left (n + 1\right )} \sin \left (f x + e\right )^{2} + c d n \sin \left (f x + e\right ) - c^{2}\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} a^{2}}{{\left (n^{2} + 3 \, n + 2\right )} d^{2}} + \frac {{\left (d \sin \left (f x + e\right ) + c\right )}^{n + 1} a^{2}}{d {\left (n + 1\right )}} + \frac {{\left ({\left (n^{2} + 3 \, n + 2\right )} d^{3} \sin \left (f x + e\right )^{3} + {\left (n^{2} + n\right )} c d^{2} \sin \left (f x + e\right )^{2} - 2 \, c^{2} d n \sin \left (f x + e\right ) + 2 \, c^{3}\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} a^{2}}{{\left (n^{3} + 6 \, n^{2} + 11 \, n + 6\right )} d^{3}}}{f} \]
(2*(d^2*(n + 1)*sin(f*x + e)^2 + c*d*n*sin(f*x + e) - c^2)*(d*sin(f*x + e) + c)^n*a^2/((n^2 + 3*n + 2)*d^2) + (d*sin(f*x + e) + c)^(n + 1)*a^2/(d*(n + 1)) + ((n^2 + 3*n + 2)*d^3*sin(f*x + e)^3 + (n^2 + n)*c*d^2*sin(f*x + e )^2 - 2*c^2*d*n*sin(f*x + e) + 2*c^3)*(d*sin(f*x + e) + c)^n*a^2/((n^3 + 6 *n^2 + 11*n + 6)*d^3))/f
Leaf count of result is larger than twice the leaf count of optimal. 436 vs. \(2 (101) = 202\).
Time = 0.34 (sec) , antiderivative size = 436, normalized size of antiderivative = 4.32 \[ \int \cos (e+f x) (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\frac {\frac {{\left ({\left (d \sin \left (f x + e\right ) + c\right )}^{3} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} n^{2} - 2 \, {\left (d \sin \left (f x + e\right ) + c\right )}^{2} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} c n^{2} + {\left (d \sin \left (f x + e\right ) + c\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} c^{2} n^{2} + 3 \, {\left (d \sin \left (f x + e\right ) + c\right )}^{3} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} n - 8 \, {\left (d \sin \left (f x + e\right ) + c\right )}^{2} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} c n + 5 \, {\left (d \sin \left (f x + e\right ) + c\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} c^{2} n + 2 \, {\left (d \sin \left (f x + e\right ) + c\right )}^{3} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} - 6 \, {\left (d \sin \left (f x + e\right ) + c\right )}^{2} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} c + 6 \, {\left (d \sin \left (f x + e\right ) + c\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} c^{2}\right )} a^{2}}{d^{2} n^{3} + 6 \, d^{2} n^{2} + 11 \, d^{2} n + 6 \, d^{2}} + \frac {{\left (d \sin \left (f x + e\right ) + c\right )}^{n + 1} a^{2}}{n + 1} + \frac {2 \, {\left ({\left (d \sin \left (f x + e\right ) + c\right )}^{2} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} n - {\left (d \sin \left (f x + e\right ) + c\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} c n + {\left (d \sin \left (f x + e\right ) + c\right )}^{2} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} - 2 \, {\left (d \sin \left (f x + e\right ) + c\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} c\right )} a^{2}}{{\left (n^{2} + 3 \, n + 2\right )} d}}{d f} \]
(((d*sin(f*x + e) + c)^3*(d*sin(f*x + e) + c)^n*n^2 - 2*(d*sin(f*x + e) + c)^2*(d*sin(f*x + e) + c)^n*c*n^2 + (d*sin(f*x + e) + c)*(d*sin(f*x + e) + c)^n*c^2*n^2 + 3*(d*sin(f*x + e) + c)^3*(d*sin(f*x + e) + c)^n*n - 8*(d*s in(f*x + e) + c)^2*(d*sin(f*x + e) + c)^n*c*n + 5*(d*sin(f*x + e) + c)*(d* sin(f*x + e) + c)^n*c^2*n + 2*(d*sin(f*x + e) + c)^3*(d*sin(f*x + e) + c)^ n - 6*(d*sin(f*x + e) + c)^2*(d*sin(f*x + e) + c)^n*c + 6*(d*sin(f*x + e) + c)*(d*sin(f*x + e) + c)^n*c^2)*a^2/(d^2*n^3 + 6*d^2*n^2 + 11*d^2*n + 6*d ^2) + (d*sin(f*x + e) + c)^(n + 1)*a^2/(n + 1) + 2*((d*sin(f*x + e) + c)^2 *(d*sin(f*x + e) + c)^n*n - (d*sin(f*x + e) + c)*(d*sin(f*x + e) + c)^n*c* n + (d*sin(f*x + e) + c)^2*(d*sin(f*x + e) + c)^n - 2*(d*sin(f*x + e) + c) *(d*sin(f*x + e) + c)^n*c)*a^2/((n^2 + 3*n + 2)*d))/(d*f)
Time = 12.41 (sec) , antiderivative size = 302, normalized size of antiderivative = 2.99 \[ \int \cos (e+f x) (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\frac {a^2\,{\left (c+d\,\sin \left (e+f\,x\right )\right )}^n\,\left (24\,c\,d^2-24\,c^2\,d+16\,d^3\,n+30\,d^3\,\sin \left (e+f\,x\right )+8\,c^3+12\,d^3-12\,d^3\,\cos \left (2\,e+2\,f\,x\right )+4\,d^3\,n^2-2\,d^3\,\sin \left (3\,e+3\,f\,x\right )+29\,d^3\,n\,\sin \left (e+f\,x\right )+6\,c\,d^2\,n^2-16\,d^3\,n\,\cos \left (2\,e+2\,f\,x\right )-3\,d^3\,n\,\sin \left (3\,e+3\,f\,x\right )+7\,d^3\,n^2\,\sin \left (e+f\,x\right )-4\,d^3\,n^2\,\cos \left (2\,e+2\,f\,x\right )-d^3\,n^2\,\sin \left (3\,e+3\,f\,x\right )+22\,c\,d^2\,n-8\,c^2\,d\,n-2\,c\,d^2\,n^2\,\cos \left (2\,e+2\,f\,x\right )+24\,c\,d^2\,n\,\sin \left (e+f\,x\right )-8\,c^2\,d\,n\,\sin \left (e+f\,x\right )-2\,c\,d^2\,n\,\cos \left (2\,e+2\,f\,x\right )+8\,c\,d^2\,n^2\,\sin \left (e+f\,x\right )\right )}{4\,d^3\,f\,\left (n^3+6\,n^2+11\,n+6\right )} \]
(a^2*(c + d*sin(e + f*x))^n*(24*c*d^2 - 24*c^2*d + 16*d^3*n + 30*d^3*sin(e + f*x) + 8*c^3 + 12*d^3 - 12*d^3*cos(2*e + 2*f*x) + 4*d^3*n^2 - 2*d^3*sin (3*e + 3*f*x) + 29*d^3*n*sin(e + f*x) + 6*c*d^2*n^2 - 16*d^3*n*cos(2*e + 2 *f*x) - 3*d^3*n*sin(3*e + 3*f*x) + 7*d^3*n^2*sin(e + f*x) - 4*d^3*n^2*cos( 2*e + 2*f*x) - d^3*n^2*sin(3*e + 3*f*x) + 22*c*d^2*n - 8*c^2*d*n - 2*c*d^2 *n^2*cos(2*e + 2*f*x) + 24*c*d^2*n*sin(e + f*x) - 8*c^2*d*n*sin(e + f*x) - 2*c*d^2*n*cos(2*e + 2*f*x) + 8*c*d^2*n^2*sin(e + f*x)))/(4*d^3*f*(11*n + 6*n^2 + n^3 + 6))